package com.dayang.redbook.auth.model.user.vo;

import com.dayang.framework.common.validator.PhoneNumber;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: dayang
 * @since: 2024/5/31
 * @description: 用户登录（支持密码或验证码两种方式）
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Schema(description = "用户登录信息请求实体")
public class UserLoginReqVO {
    /**
     * 手机号
     */
    @Schema(description = "手机号")
    @NotBlank(message = "手机号不能为空")
    @PhoneNumber
    private String phone;

    /**
     * 验证码
     */
    @Schema(description = "验证码")
    private String code;

    /**
     * 密码
     */
    @Schema(description = "密码")
    private String password;

    /**
     * 登录类型：手机号验证码，或者是账号密码
     */
    @Schema(description = "登录类型(1-验证码登录 2-密码登录)")
    @NotNull(message = "登录类型不能为空")
    private Integer type;
}
